<template>
  <div class="gamecategory" v-loading="loading">
    <ul>
      <li v-for="(item, index) in category" :key="index">
        <game-item :indexs="index" :categorys="item"></game-item>
      </li>
    </ul>
  </div>
</template>

<script>
import { getCategory } from "../../../network/gameCategory";

import GameItem from "./gameItem";
export default {
  components: { GameItem },
  name: "GameCategory",
  data() {
    return {
      category: "",
      loading: true,
    };
  },
  created() {
    getCategory().then((res) => {
      this.category = res.data.data;
      this.loading = false;
    });
  },
};
</script>

<style>
.gamecategory {
  width: 80%;
  margin: 0 auto;
  margin-top: 0.1rem;
  margin-bottom: 1rem;
  display: flex;
}

.gamecategory ul {
  width: 100%;
  list-style: none;
}

.gamecategory ul li {
  float: left;
  display: flex;
  width: 20%;
  margin-top: 0.2rem;
  position: relative;
}
</style>